console.log(".........publicHeader...........");
let publicHeader = new Vue({
    el: "#publicHeaderApp",
    data: {
        keyword:'',
        account:''
    },
    methods: {
        toSearch(){
            if (this.keyword){
                index.keyword=this.keyword;
                index.pageSize=3;
                index.currentPage=1;
                index.initProduct();
            }
        }
        ,
        getCurrentAccount(){
            let _this = this;
            $.get("/user/currentAccount",function (data) {
                _this.account = data;
                console.log(data)
            })
        }
        ,
        loginOut(){
            console.log("退出")
            $.get("/user/loginOut",function (data) {
                if (data==="ok"){
                    location.href="/index.html";
                }
            })
        }
    },
    created(){
        this.getCurrentAccount();
    }
});
